package com.zhiyin.seal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyin.seal.entity.SystemLogEntity;
import com.zhiyin.seal.entity.SystemRoleEntity;
import com.zhiyin.seal.entity.SystemUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface AdminWebDao extends BaseMapper {

    SystemUserEntity selectSystemUserByNameAndPwd(@Param("userName") String userName, @Param("password") String password);

    List<SystemRoleEntity> selectRoleList();

    Integer insertRole(@Param("name") String name);

    List<Long> selectRoleRightIdList(@Param("roleId") Long roleId);

    Integer insertOrUpdateRoleRight(@Param("roleId") Long roleId,@Param("menuIdList") List<Long> menuIdList);

    Integer deleteRole(@Param("roleId") Long roleId);

    List<SystemUserEntity> selectUserList();

    SystemUserEntity selectSystemUserByName(@Param("userName") String userName);

    Integer insertSystemUser(@Param("systemUser") SystemUserEntity systemUserEntity);

    Integer updateSystemUserPassword(@Param("userId") Long userId,@Param("pwd") String pwd);

    Integer updateUserRole(@Param("userId") Long userId,@Param("roleId") Long roleId);

    Integer deleteSystemUser(@Param("userId") Long userId);

    Integer insertSystemLog(@Param("systemLog")SystemLogEntity systemLogEntity);

    List<SystemLogEntity> selectSystemLog();
}
